<template>
	<div class="newPress">
		<h3>{{list.title}}</h3>
		<p class="title-list">
			<span>发表时间:<span>{{list.add_time | times('YYYY-MM-DD HH-mm-ss')}}</span></span>
			<span>浏览:<span>{{list.click}}</span>次</span>
		</p>
		<hr />
		<div class="conten" v-html="list.content">
			
		</div>
		<comments :uId = 'id'></comments>
	</div>
</template>

<script>
	import {Toast} from 'mint-ui'
	import assem from '../assembly/assem.vue'
	export default{
		data(){
			return {
				id:this.$route.params.id,
				list:{}
			}
		},
		created(){
			
			this.get()
		},
		methods: {
			get(){
				this.$http.get('api/getnew/'+this.id).then(
					(resolve)=>{
						if (resolve.body.status == 0) {
							this.list = resolve.body.message[0];
						} else{
							Toast('获取新闻详情失败！')
						}
					
					},(reject)=>{
						Toast('网络失败')
					}
				)
			}
		},
		components:{
			'comments':assem
		}
	}
</script>

<style lang = 'less'>
	.newPress{
		.title-list{
			display: flex;
			justify-content: space-between;
			font-size: 12px;
			color: #0000FF;
			padding: 0 2em;
		}
		h3{
			color: red;
			padding: 0.5em 0.5em;
		}
		.conten{
			padding: 0 10px;
			margin-bottom: 3.5em;
			img{
				width: 100%;
				height: 100%;
			}
		}
	}
	
	
</style>
